/* 우편번호 찾기 */
$("#findbtn").click(function() {
	if ($("#dong").val() != "") {
		$("#ziplist *").remove();
		var reqAjax = $.ajax({url: "zipcode.bi", type: "POST", data: {dong: $("#dong").val()}});
		reqAjax.done(function(result){
			$(result).appendTo("#ziplist");
		});
		reqAjax.fail(function (jqXHR, status){
			alert("error : " + status);
		});
	} else {
		alert("검색어를 입력하세요");
	}
});	// 검색버튼
$("#okbtn").click(function() {
	var selectOne = $("#ziplist").val().split(" ");
	$("#zip1").val(selectOne[0].split("-")[0]);
	$("#zip2").val(selectOne[0].split("-")[1]);
	var s = selectOne[1];
	for (var i=2; i<selectOne.length; ++i) {
		s = s + " " + selectOne[i];
	}
	$("#addr1").val(s);
	$("#ziplist *").remove();
});
$("#closebtn").click(function(){
	$("#ziplist *").remove();
});